from building import *

cwd     = GetCurrentDir()

src = Split('''
modbus.c
modbus-data.c
''')

if GetDepend(['PKG_USING_LIBMODBUS_RTU']):
    src += Glob('modbus-rtu.c')

if GetDepend(['PKG_USING_LIBMODBUS_TCP']):
    src += Glob('modbus-tcp.c')

CPPPATH = [cwd]

group = DefineGroup('libmodbus', src, depend = ['PKG_USING_LIBMODBUS'], CPPPATH = CPPPATH)

Return('group')
